package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SUPPLIER database table.
 * 
 */
@Entity
@NamedQuery(name="Supplier.findAll", query="SELECT s FROM Supplier s")
public class Supplier implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="SUPPLIER_ID")
	private long supplierId;

	@Column(name="SUPPLIER_NAME")
	private String supplierName;

	@Column(name="SUPPLIER_NOTE")
	private String supplierNote;

	//bi-directional many-to-one association to DrugstorageGetdrugsDetail
	@OneToMany(mappedBy="supplier")
	private List<DrugstorageGetdrugsDetail> drugstorageGetdrugsDetails;

	//bi-directional many-to-one association to StorageWithdrawelDetail
	@OneToMany(mappedBy="supplier")
	private List<StorageWithdrawelDetail> storageWithdrawelDetails;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="STAFF_ID")
	private Staff staff;

	public Supplier() {
	}

	public long getSupplierId() {
		return this.supplierId;
	}

	public void setSupplierId(long supplierId) {
		this.supplierId = supplierId;
	}

	public String getSupplierName() {
		return this.supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public String getSupplierNote() {
		return this.supplierNote;
	}

	public void setSupplierNote(String supplierNote) {
		this.supplierNote = supplierNote;
	}

	public List<DrugstorageGetdrugsDetail> getDrugstorageGetdrugsDetails() {
		return this.drugstorageGetdrugsDetails;
	}

	public void setDrugstorageGetdrugsDetails(List<DrugstorageGetdrugsDetail> drugstorageGetdrugsDetails) {
		this.drugstorageGetdrugsDetails = drugstorageGetdrugsDetails;
	}

	public DrugstorageGetdrugsDetail addDrugstorageGetdrugsDetail(DrugstorageGetdrugsDetail drugstorageGetdrugsDetail) {
		getDrugstorageGetdrugsDetails().add(drugstorageGetdrugsDetail);
		drugstorageGetdrugsDetail.setSupplier(this);

		return drugstorageGetdrugsDetail;
	}

	public DrugstorageGetdrugsDetail removeDrugstorageGetdrugsDetail(DrugstorageGetdrugsDetail drugstorageGetdrugsDetail) {
		getDrugstorageGetdrugsDetails().remove(drugstorageGetdrugsDetail);
		drugstorageGetdrugsDetail.setSupplier(null);

		return drugstorageGetdrugsDetail;
	}

	public List<StorageWithdrawelDetail> getStorageWithdrawelDetails() {
		return this.storageWithdrawelDetails;
	}

	public void setStorageWithdrawelDetails(List<StorageWithdrawelDetail> storageWithdrawelDetails) {
		this.storageWithdrawelDetails = storageWithdrawelDetails;
	}

	public StorageWithdrawelDetail addStorageWithdrawelDetail(StorageWithdrawelDetail storageWithdrawelDetail) {
		getStorageWithdrawelDetails().add(storageWithdrawelDetail);
		storageWithdrawelDetail.setSupplier(this);

		return storageWithdrawelDetail;
	}

	public StorageWithdrawelDetail removeStorageWithdrawelDetail(StorageWithdrawelDetail storageWithdrawelDetail) {
		getStorageWithdrawelDetails().remove(storageWithdrawelDetail);
		storageWithdrawelDetail.setSupplier(null);

		return storageWithdrawelDetail;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

}